POV-Ray : Newsgroups : povray.general : Filling a hourglass with sand? : Re: Filling a hourglass with sand? Server Time
30 Jul 2024 00:28:12 EDT (-0400)
  Re: Filling a hourglass with sand?  
From: Alain
Date: 21 Feb 2010 14:07:19
Message: <4b818467@news.povray.org>

> Hola,
>
> Looking for suggestions on how to fill a hourglass with sand. So far my
> attempt(s), (macro placing grains bounded_by hourglass shape), isn't giving
> any joy. Wasn't there a bowl of cheerios example floating around somewhere?
> If not, maybe I was thinking of something else!
>
> Jim
> BTW: want all the sand to be at the bottom
>
>

Do you want to place each *grain* individualy?
If so, fist, you create a reference object. Is must be a shell slightly 
smaller than the hourglass and have a relatively small thickness. That 
object will have the shape of the sand.
Then, you randomly chose points in it's bounding box and do an inside 
test. Keep trying until the point is inside the shell then place an 
object. You probably don't need to prevent the grains from intersecting, 
so, you can probably skip any colision test.
At each point, you place one grain: a sphere, a randomly rotated box or 
a small mesh, also randomly rotated.
You will probably end up with a few 1000000 objects. Put them all in a 
single union and use a single texture for the whole union.

The best way would be to have a single object very slightly smaler than 
the part where you want the sand to be. It can be a lathe or sor object 
intersected with a height_field.
Then, the trick is to create a nice sand texture.



Alain


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.